import request from '@/utils/request';

// 校验用户名是否存在
export function exist(data) {
  return request({
    url: '/api/accounts/exist',
    method: 'post',
    data,
  });
}

//  验证码发送
export function sendCode(phone) {
  return request({
    url: `/api/phone/send-code/${phone}`,
    method: 'post',
  });
}
// 获取验证码
export function getCode(bid) {
  return request({
    url: `/api/phone/${bid}`,
    method: 'get',
  });
}
// 验证码校验
export function checkCode(data) {
  return request({
    url: '/api/phone/check-code',
    method: 'post',
    data,
  });
}
export default {
  exist,
  sendCode,
  getCode,
  checkCode,
};
